package com.mlingdu.ffmpegdecoder;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import org.voiddog.ffmpeg.NativePlayer;

public class MainActivity extends Activity {
    private EditText mInput;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
    }
    private void init(){
        mInput = (EditText) findViewById(R.id.et_input);
        mInput.setText("http://qzone.60dj.com/huiyuan/201704/19/201704190533197825_35285.mp3");
        findViewById(R.id.bt_play).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                NativePlayer.play(mInput.getText().toString().trim());
            }
        });
        findViewById(R.id.bt_pause).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                NativePlayer.stop();
            }
        });
    }
}
